package com.ruoyi.business.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.ruoyi.business.domain.SysArea;
import lombok.Data;

import java.io.Serializable;

/**
 * 地区视图对象 sys_area
 *
 * @author ruoyi
 * @date 2024-04-20
 */
@Data
@ExcelIgnoreUnannotated
public class SysAreaVo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 索引ID
     */
    @ExcelProperty(value = "索引ID")
    private Long areaId;

    /**
     * 地区名称
     */
    @ExcelProperty(value = "地区名称")
    private String areaName;

    /**
     * 地区父ID
     */
    @ExcelProperty(value = "地区父ID")
    private Long areaParentId;

    /**
     * 地区深度，从1开始
     */
    @ExcelProperty(value = "地区深度，从1开始")
    private Long areaDeep;

    public SysAreaVo build(SysArea sysArea) {
        this.areaId = sysArea.getAreaId();
        this.areaName = sysArea.getAreaName();
        this.areaParentId = sysArea.getAreaParentId();
        this.areaDeep = sysArea.getAreaDeep();
        return this;
    }
}
